﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OneMG.Phoenix.Service.Model;
using OneMG.Phoenix.Service.Contracts;
using OneMG.Phoenix.Service;
namespace OneMG.Phoenix.AdminSite.Views.Category
{
    public partial class Index : System.Web.UI.Page
    {
        ICategoryService ICategory = new CategoryService();

        public IList<CategoryModel> listModle = new List<CategoryModel>();

        public int parentID = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int pid = 0;
                int.TryParse(Request.QueryString["pid"],out pid);

                parentID = pid;

                GetCategory(pid);
            }
        }

        private void GetCategory(int pid)
        {
            listModle = ICategory.GetByParentID(pid);
        }
    }
}
